<script lang="ts" setup>
  //wangeditor文档 https://www.wangeditor.com/v5/getting-started.html
  import { get, post, Message, loadFile } from '@/utils';
  import Editor from '@/components/Editor/index.vue';
  import isEmpty from 'lodash/isEmpty';
  const props = defineProps<{ info: Product }>();
  const content = ref('');
  watch(
    () => props.info,
    (n) => {
      if (!isEmpty(n)) {
        content.value = props.info.detail;
      }
    }
  );
  defineExpose({
    data: content,
  });
</script>
<template>
  <div class="ditor">
    <Editor
      style="height: 400px; overflow-y: hidden"
      v-model:content="content"
    />
  </div>
</template>
<style lang="less" scoped>
  .ditor {
    padding-top: 30px;
    .content {
      border: 1px solid #ccc;
    }
  }
</style>
